﻿using System.Linq;
using System.Text;
using System.Windows.Data;
using System;
using System.Globalization;
namespace ZhiHeng.OneCard.WpfClient.Common
{
    [ValueConversion(typeof(string), typeof(String))]
    public class BoxStatusConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            string str = "";
            try
            {
                str = (value==null || value.ToString() == "0" || value.ToString() == "") ? "可用" : "不可用";
            }
            catch (Exception ex)
            {
                return "不可用";
            }

            return str;
        }



        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
